package com.zmx.common.common.utils.bitmap;

/**
 * @Description: 解决跳跃式，数据分布不均匀BitMap
 * @ClassName: JumpBitMap
 * @Author zhaomxr
 * @Date 2021-12-03 10:21
 */
public class JumpBitMap {

    /**
     * 使用long类型存储 一个存64位，
     */
    private long[] longs;

    /**
     * 最大容量
     */
    private int capacity;

    public JumpBitMap(int capacity) {
        this.capacity = capacity;
        longs = new long[(capacity >> 6) + 1];
    }

    public void add(int elment){
        int code = (elment >> 6) + 1;

        int position = elment & 0X3F;

        longs[code] |= 1 << position;
    };



}
